import java.net.MalformedURLException;


public class Point {
	int x;
	int y;
	float longitude;
	float latitude;
	boolean startPoint;
	Point prePoint = null;
	Point postPoint = null;
	
	Panel delegateMap;
	
	public Point(int _x, int _y,Panel $delegate){
		x = _x;
		y = _y;
		delegateMap = $delegate;
		if(x != -1)
			translate();
		
		startPoint = false;
	}
	
	public void setStart(){
		startPoint = true;
	}
	
	public void translate(){
		//uses database against current GPS to estimate feet to degree ratio at given coordinates and translate to long+lat
		//note: scale should remain constant for current implementation
		int temp = delegateMap.sizeX/2 - x;
		longitude = delegateMap.longitude - temp*delegateMap.scaleLonPPX;
		
		temp = delegateMap.sizeY/2 - y;
		latitude = delegateMap.latitude + temp*delegateMap.scaleLatPPY;
	
	}
}
